count the total number of keys from nested objects and arrays